package com.yanfan.ccapicode.controller;

import com.yanfan.ccapicode.bean.DataResponse;
import com.yanfan.ccapicode.bean.info.ThirdPartyCloudConfigInfo;
import com.yanfan.ccapicode.service.ThirdPartyConfigService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * :)
 * */
@RestController
@RequestMapping("/thirdPartyCloud/")
public class ThirdClientConfigController {


    private final ThirdPartyConfigService thirdPartyCloudService;

    public ThirdClientConfigController(ThirdPartyConfigService thirdPartyCloudService) {
        this.thirdPartyCloudService = thirdPartyCloudService;
    }

    @PostMapping("/getConfig")
    public DataResponse<ThirdPartyCloudConfigInfo> getConfig(@RequestParam("clientId") String clientId){
        ThirdPartyCloudConfigInfo config = thirdPartyCloudService.getConfig(clientId);
        return DataResponse.of(config);
    }
}
